import request from "@/utils/request";
import store from "@/store";

// 查询数据
export function getDataListApi(params) {
  return request({
    url: '/saas/problemSummary/list',
    method: 'GET',
    params: {
      ...params,
      userId: store.state.user.id,
      deptId: store.state.user.deptId,
    }
  })
}

// 增加数据
export function addDataApi(data) {
  return request({
    url: '/saas/problemSummary/add',
    method: 'POST',
    data: {
      ...data,
      userId: store.state.user.id,
      deptId: store.state.user.deptId,
    }
  })
}

// 修改数据
export function updateDataApi(data) {
  return request({
    url: '/saas/problemSummary/update',
    method: 'PUT',
    data
  })
}

// 删除数据
export function deleteDataApi(data) {
  return request({
    url: '/saas/problemSummary/delete/' + data.id,
    method: 'DELETE',
    // data
  })
}

// 上传图片
export function uploadImgApi(data) {
  return request({
    url: '/crm/product/uploadImage',
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
}
